<template>
  <div class="print-event">
    <table width="100%" border="1" cellspacing="0">
      <tr>
        <td colspan="9">质量事件信息</td>
      </tr>
      <tr>
        <td>工单号</td> <td>类型</td> <td>规格</td> <td>品名</td> <td>品名</td> <td>不合格来源</td> <td>不合格数量</td>  <td>总数</td> <td>创建时间</td>

      </tr>
      <tr>
        <td>{{ctx.prod_no}}</td><td>{{ctx._kind_label}}</td> <td>{{ctx.model_spec}}</td> <td>{{ctx.model_name}}</td> <td>{{ctx.model_no}}</td> <td>{{ctx.fail_source}}</td> <td>{{ctx.fail_count}}</td> <td>{{ctx.total_count}}</td> <td>{{ctx.create_time}}</td>
      </tr>
      <tr>
        <td colspan="9">不合格内容</td>
      </tr>
      <template v-for="item in ctx.fail_content">
        <tr >
          <td rowspan="4">{{item._abstract_label}}</td>    <td>数量</td> <td colspan="3">详细描述</td> <td>处理方案</td><td>不良分类</td><td></td> <td></td>
        </tr>
        <tr>
          <td>{{item.count}}</td> <td colspan="3">{{item.detail_desp}}</td> <td>{{item._process_kind_label}}</td> <td>{{item._fail_kind_label}}</td> <td></td><td></td>
        </tr>
        <tr>
          <td>技术意见</td><td colspan="7">{{item.tech_advice}}</td>
        </tr>
        <tr>
          <td>纠正预防措施</td><td colspan="7">{{item.tech_correct_action}}</td>
        </tr>
      </template>
      <tr>
        <td><span class="blank"></span></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td>
      </tr>
      <tr>
        <td colspan="9">措施验证</td>
      </tr>
      <tr>
        <td colspan="9">
          <span class="big-blank">
            {{ctx.validate_action}}
          </span>
        </td>
      </tr>
      <tr>
        <td><span class="blank"></span></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td>
      </tr>
      <tr>
        <td colspan="9">总经办审批意见</td>
      </tr>
      <tr>
        <td colspan="9">
          <span class="big-blank">
              {{ctx.approval_suggest}}
          </span>

          </td>
      </tr>

    </table>
  </div>
</template>
<script>
export default  {
  props:{
    ctx:{},
  },
  mounted(){
    setTimeout(()=>{
      window.print();
    },2000)
  }
}
</script>
<style scoped lang="scss">

table, th, td {
  border: 1px solid black;
}

.print-event{
  width: 1000px;
  margin: auto;
  //border:1px solid grey;
  min-height: 600px;
  padding-top: 50px;
}
.blank{
  display: inline-block;
  height: 20px;
}
.big-blank{
  display: inline-block;
  min-height: 40px;
}
td:before {
  content: '';
  display: block;
  width: 5em;
}
</style>